package com.lingnan.blog.utils;

import java.util.UUID;

/**
 * uuid工具类
 *
 * @author HeGuanChao
 */
public class UUIDUtil {
    public static String getUUID() {
        return UUID.randomUUID().toString().replace("-", "");
    }

    public static Long getUUIDInOrderId() {
        long orderId = UUID.randomUUID().toString().hashCode();
        //String.hashCode() 值会为空
        orderId = orderId < 0 ? -orderId : orderId;
        return orderId;
    }
}
